<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8" %>
<link rel="stylesheet" href="../../css/style1.css"/>
<ul style="width: 900px">
    <li><a href="liststudentsbypaging.jsp?page=1" >首 页</a></li>
    <%
        if(currentPage!=1){
    %>
    <li><a href="liststudentsbypaging.jsp?page=<%=currentPage-1%>"> 上一页</a></li>
    <%
        }
    %>
    <%
        if(currentPage!=pageUtil.getMaxPage()){
    %>
    <li><a href="liststudentsbypaging.jsp?page=<%=currentPage+1%>"> 下一页</a></li>
    <%
        }
    %>
    <li><a href="liststudentsbypaging.jsp?page=<%=pageUtil.getMaxPage()%>" >尾 页</a></li>
    <li style="width:300px">
        <form action="liststudentsbypaging.jsp" method="post">
            跳转到 <select name="page" id="selectPage">
                <option>请选择</option>
        </select>页<input type="submit" name="submit" value="确定"/>
        </form>
    </li>
</ul>
<script>
    function  insertPage(element,maxPage){
        for(i=1;i<=maxPage;i++){
            element.options.add(new Option(i,i));
        }
    }
    insertPage(document.getElementById("selectPage"),"<%=pageUtil.getMaxPage()%>");

</script>
<%
    int pageSize2=5;
    if(currentPage%pageSize2==0){
        for(int i=1+currentPage;i<=currentPage+pageSize2&& i<=pageUtil.getMaxPage() ;i++){

%>
<a href="liststudentsbypaging.jsp?page=<%=i%>"><%=i%>&nbsp;</a>
<%
    }
    }
%>